
var _PITTSBURGH="digitalstore branch #7,digitalstore branch #10,digitalstore branch #26,digitalstore branch #29,digitalstore branch #31,digitalstore branch #42,digitalstore branch #44,digitalstore branch #47";
var _PHILADELPHIA="digitalstore branch #0,digitalstore branch #4,digitalstore branch #5,digitalstore branch #12,digitalstore branch #16,digitalstore branch #18,digitalstore branch #22,digitalstore branch #23,digitalstore branch #33,digitalstore branch #37,digitalstore branch #39";
var _YORK = "digitalstore branch #1,digitalstore branch #3,digitalstore branch #8,digitalstore branch #24,digitalstore branch #27,digitalstore branch #34,digitalstore branch #36,digitalstore branch #41,digitalstore branch #43,digitalstore branch #45";
var _SCRANTON="digitalstore branch #2,digitalstore branch #9,digitalstore branch #11,digitalstore branch #13,digitalstore branch #14,digitalstore branch #17,digitalstore branch #19,digitalstore branch #25,digitalstore branch #32,digitalstore branch #40";
var _WILLIAMPORT="digitalstore branch #6,digitalstore branch #15,digitalstore branch #20,digitalstore branch #21,digitalstore branch #28,digitalstore branch #30,digitalstore branch #35,digitalstore branch #38,digitalstore branch #46,digitalstore branch #48,digitalstore branch #49";

var _BOOKS = "BUSINESS,ENTERTAINMENT,FICTION,GENERAL INTEREST,HEALTH,HISTORY,HOBBIES,LAW";
var _CLOTHES ="ARMWEAR,BELTS,CHILDREN'S CLOTHING,COATS,DRESSES,FOOTWEAR,HEADGEAR,JACKETS,NECKWEAR,SKIRTS,SUITS,SWIMSUITS,TROUSERS AND SHORTS,UNDERWEAR";
var _MACHINE = "CAR,COMPUTER,LAPTOP,MENIFACTORY,SENSOR";
var _MEDICINE ="AVIATION,CARDIOLOGY,DISASTER MEDICINE,EMERGENCY MEDICINE,IMMUNOLOGY,MILITARY MEDICINE,REHABILITATION MEDICINE,SPORTS MEDICINE";
var _TOOLS = "ADVERTISING TOOLS,ALCHEMICAL TOOLS,BICYCLE TOOLS,CLEANING TOOLS,COOKING TOOLS,ELECTRICAL TOOLS,FARMING TOOLS,GARDENING TOOLS,PORTABLE TOOLS,POWER TOOLS";
var _FOOD = "BEEF,BISCUITS,BREAD,BUTTER AND MARGARINE,CAKES,CHICKEN,FISH AND SEAFOOD,FRUIT";


function deleteCookie(name){
    document.cookie = name+"=;expires="+(new Date(0)).toGMTString();
}

function setCookie(name,value){
    document.cookie = name+"=" + escape (value);
}

function Hop(url){
    window.location.href=url;
}

function jump1(){
    var arg=arguments[0].split("=");
    switch(arg[0]){
        case "text":
        
       
       var strCookie=document.cookie;
       var arrCookie=strCookie.split(";");
       
       for(var i=0;i<arrCookie.length;i++){
           var arr=arrCookie[i].split("=");
           if (arr[0]!='text')
              deleteCookie(arr[0]);
       }
                
                
                
                var textVal;
                textVal=document.getElementById('textAr').value;
                if (textVal!=null&textVal!=undefined){
                    setCookie('text',textVal);
                }
                else if (window.location.href.indexOf('text=')>0)
                    {if (arg[1]!=' ')
                          setCookie('text',arg[1]);
                    }
                
            break;
        case "category":
            if(arg[1]=="Any"){
                deleteCookie("category");
            }else{
                _parent = arg[1];
                setCookie("category",arg[1]);
            }
            break;
        case "subcategory":
                setCookie("category",arg[1]);
            break;
        case "region":
            if(arg[1]=="Any"){
                deleteCookie("region");
            }else{
                setCookie("region",arg[1]);
                deleteCookie("store");
            }
            break;
        case "store":
            if(arg[1]=="Any"){
                deleteCookie("store");
            }else{
                setCookie("store",arg[1]);
            }
            break;
        case "pricerange":
            if(arg[1]=="Any"){
                deleteCookie("pricerange");
            }else{
                setCookie("pricerange",arg[1]);
            }
            break;
    }
    Hop("search.php?myself=true");
}       




function test(regionname){
    var OptionZone=document.getElementById('selectID');
    OptionZone.innerHTML='<option value = "Any" onclick = "jump1('+"'"+'store=Any'+"'"+')">Any</option>';
    
    var temp;
    
    if(regionname == "PITTSBURGH")temp = _PITTSBURGH;
    if(regionname == "YORK")temp = _YORK;
    if(regionname == "WILLIAMPORT")temp = _WILLIAMPORT;
    if(regionname == "SCRANTON")temp = _SCRANTON;
    if(regionname == "PHILADELPHIA")temp = _PHILADELPHIA;
    
    arr = temp.split(",");
    for(var i=0;i<arr.length;i++){
        
       OptionZone.innerHTML=OptionZone.innerHTML+'<option title = "op" id = "'+arr[i]+'"'+'value = "'+arr[i]+'" onclick = "jump1('+"'store="+(parseInt(arr[i].split("#")[1])+1)+"'" +')">'+arr[i]+'</option>';
    }
}


function test1(categoryname){
    var OptionZone=document.getElementById('SubID');
    
     var tempo;
    
    if(categoryname == "FOOD")tempo = _FOOD;
    if(categoryname == "CLOTHES")tempo = _CLOTHES;
    if(categoryname == "MACHINE")tempo = _MACHINE;
    if(categoryname == "MEDICINE")tempo = _MEDICINE;
    if(categoryname == "BOOKS")tempo = _BOOKS;
    if(categoryname == "TOOLS")tempo = _TOOLS;
    
    arr = tempo.split(",");
    for(var i=0;i<arr.length;i++){
      
       OptionZone.innerHTML=OptionZone.innerHTML+'<option title = "op" id = "'+arr[i]+'"'+'value = "'+arr[i]+'" onclick = "jump1('+"'subcategory="+arr[i]+"'" +')">'+arr[i]+'</option>';
    }
}


 function radioactivate(){
       var strCookie=document.cookie;
       var arrCookie=strCookie.split(";");
       
       for(var i=0;i<arrCookie.length;i++){
          var arr=arrCookie[i].split("=");
          
          var obj = document.getElementById(unescape(arr[1]));
          
          if (obj!=undefined && obj!=null){
              if (obj.title=='op')
                obj.selected = true;
              if (obj.title=='inp')
                obj.checked = true;
          }
          

       }
}
                